import axios from "./config"
//登入
export const login = (username, password) => axios({
    url: "/users/login",
    method: 'post',
    data: {
        username,
        password
    }
})


//获取登入日志
/**
 * 
 * @param {Object} _this 一个组件实例 
 */
export const getLoginLog = (_this) => axios.get("/getloginlog")

//获取用户菜单

export const getMenuList = () => axios.get("/permission/getMenuList")

//获验证码/users/getCaptcha
export const getCaptcha = () => axios.get("/users/getCaptcha")
//刷新验证码
export const refreshCaptcha = () => axios.get("/users/refreshCaptcha")
//校验验证码
export const verifyCaptcha = (captcha) => axios.get(`/users/verifyCaptcha?captcha=${captcha}`)

//获取学员信息
export const getStuList = (captcha) => axios.get(`/students/getstulist`)

//增加学员信息
export const addStuDetail = (stuDetail) => axios({
    url: "/students/addstu",
    method: 'post',
    data: stuDetail
})
//删除学员
export const delStu = (sId) => axios.get(`/students/delstu?sId=${sId}`)
//编辑学员信息

export const updateStu = (updated = {}) => axios({
    url: '/students/updatestu',
    method: 'post',
    data: updated
  })